import logging
from pprint import pprint


def dump_logger(name):
    g = logging.getLogger(name)
    print("LOGGER:", name)
    print("  disabled:", g.disabled)
    print("  level:", g.level, "effective:", g.getEffectiveLevel())
    print("  propagate:", g.propagate)
    print("  handlers:", [type(h).__name__ for h in g.handlers])
    for h in g.handlers:
        print("    ->", h, getattr(h, "stream", None))
    print()


print("ROOT handlers:", [type(h).__name__ for h in logging.getLogger().handlers])
pprint(logging.getLogger().handlers)
print("Root level:", logging.getLogger().level)
print()

# check our app logger and uvicorn loggers
for name in ("", "admin", "uvicorn", "uvicorn.error", "uvicorn.access"):
    dump_logger(name)
